package com.jch.dm.chapter_14_chain_of_responsibility;

/**
 * @author: Administrator
 *  解决奇数编号问题
 * @create: 2020/04/02 17:03
 **/
public class OddSupport extends Support {

    public OddSupport(String name) {
        super(name);
    }

    /**
     * 解决问题的方法
     *
     * @param trouble 问题
     * @return 是否解决
     */
    @Override
    protected boolean resolve(Trouble trouble) {
        if (trouble.getNumber() % 2 == 1) {
            return true;
        }
        return false;
    }
}
